﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;

namespace BLL
{
    public class SOP_ProductKeyLogsBLL
    {
        #region 私有变量
        private static  SOP_ProductKeyLogsDAL _dal;
        private static SOP_ProductKeyLogsDAL dal
        {
            get
            {
                if (_dal == null)
                {
                    _dal = new SOP_ProductKeyLogsDAL();
                }
                return _dal;
            }
        }
        #endregion
        //注册
        public static int Register(SOP_ProductKeyLogs model,out int companyId)
        {
            return dal.Register(model,out companyId);
        }
       
        /// <summary>
        /// 获取SOP_ProductKeyLogsDAL
        /// </summary>
        /// <param name="BossID"></param>
        /// <returns></returns>
        public static SOP_ProductKeyLogs GetAllProductKeyLogsByBossID(int CompanyId, int UserId, string strWhere)
        {
            return dal.GetAllProductKeyLogsByBossID(CompanyId, UserId,strWhere);
        }

         /// <summary>
        /// 更新状态
        /// </summary>
        /// <param name="CompanyId"></param>
        /// <param name="UserId"></param>
        /// <returns></returns>
        public static int UpdateProductKeyLogs(int CompanyId, int UserId)
        {
            return dal.UpdateProductKeyLogs(CompanyId, UserId);
        }

         /// <summary>
        /// 获取注册用户下帐号
        /// </summary>
        /// <param name="BossID"></param>
        /// <returns></returns>
        public static IList<SOP_ProductKeyLogs> GetAllProductKeyLogsByBossID(int UserId, string strWhere)
        {
            return dal.GetAllProductKeyLogsByBossID(UserId, strWhere);
        }


        #region 获取vipuser和username
        /// <summary>
        /// 取得新的账号ID
        /// </summary>
        /// <param name="brandType">取得商户类型 5多品牌 10 单品牌</param>
        /// <param name="recordSize">取得店铺账号的个数</param>
        /// <returns>账号信息</returns>
        public static int GetNewUserId(int brandType, int recordSize, out string VipUserID, out string UserName)
        {
            return dal.GetNewUserId(brandType, recordSize, out VipUserID, out UserName);
        }
        #endregion

        #region app
        /// <summary>
        /// 获取可以开通的app数据
        /// </summary>
        /// <returns></returns>
        public static IList<ArcSoftCloudApp> GetUseArcSoftCloudApp()
        {
            return dal.GetUseArcSoftCloudApp();
        }
        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="List"></param>
        /// <param name="VipUserID"></param>
        /// <returns></returns>
        public static int AddApplyByList(IList<AppApply> List, string VipUserID)
        {
            return dal.AddApplyByList(List, VipUserID);
        }
        #endregion

        #region 权限模块
        //获取某个类型对应模块
        public static int SetBrandVersionPermissionsByBossVersionType(string VipUserID, int VersionType)
        {
            return dal.SetBrandVersionPermissionsByBossVersionType(VipUserID, VersionType);
        }
        #endregion
    }
}
